package cc.yugu.yhdw.webserver.persistence.hdw;

import cc.yugu.yhdw.common.domain.hdw.CabinetBox;
import cc.yugu.yhdw.common.persistence.MasterMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 箱体信息
 * 
 * @Date:Created in 2018/6/30 11:31
 * @Author:
 * @Modified By: zjn 2018/6/30 11:31
 */ 
public interface CabinetBoxMapper extends MasterMapper {
    /**
    * 根据柜子id和箱号 查询表hdw_cabinet_box
    *
    * @Param: [cabinetId, boxNum]
    * @Return: cc.yugu.yhdw.common.domain.hdw.CabinetBox
    * @Author By: zjn 2018/6/30  11:31
    */
    public CabinetBox find(@Param("cabinetId") String cabinetId, @Param("boxNum") String boxNum);
    /**
    * 按条件查询
    *
    * @Param: [cabinetBox]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.CabinetBox>
    * @Author By: zjn 2018/6/30  11:31
    */
    public List<CabinetBox> findPageResult(CabinetBox cabinetBox);
    /**
    * 按条件查询 箱号
    *
    * @Param: [cabinetId, boxStatus, chargeStage]
    * @Return: java.util.List<java.lang.String>
    * @Author By: zjn 2018/6/30  11:31
    */
    public List<String> findAvailableBoxNum(@Param("cabinetId") String cabinetId, @Param("boxStatus") int boxStatus, @Param("chargeStage") Integer chargeStage);
    /**
    * 根据柜子查询
    *
    * @Param: [cabinetId]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.CabinetBox>
    * @Author By: zjn 2018/6/30  11:31
    */
    public List<CabinetBox> findList(@Param("cabinetId") String cabinetId);
    /**
    * 插入
    *
    * @Param: [cabinetBox]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:31
    */
    public int insert(CabinetBox cabinetBox);
    /**
    * 更新表
    *
    * @Param: [cabinetBox]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:31
    */
    public int update(CabinetBox cabinetBox);
    /**
    * 根据柜子id和箱号id更新
    *
    * @Param: [cabinetBox]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:32
    */
    public int clean(CabinetBox cabinetBox);
    /**
    * 根据电池id更新充电阶段
    *
    * @Param: [batteryId, chargeStage]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:32
    */
    public int updateChargeStage(@Param("batteryId") int batteryId, @Param("chargeStage") int chargeStage);
    /**
    * 按条件删除
    *
    * @Param: [cabinetId, boxNum]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:32
    */
    public int delete(@Param("cabinetId") String cabinetId, @Param("boxNum") String boxNum);
    /**
    * 按条件删除
    *
    * @Param: [cabinetId]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:32
    */
    public int deleteByCabinet(String cabinetId);
    /**
    * 按条件更新
    *
    * @Param: [cabinetId, boxNum]
    * @Return: int
    * @Author By: zjn 2018/6/30  11:32
    */
    public int clearByBox(@Param("cabinetId") String cabinetId, @Param("boxNum") String boxNum);
}
